<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ page import="hk.dao.DaoMenu" %>
<%@ page import="hk.dao.impl.DaoMenuImpl" %>
<%@ page import="hk.pojo.MenuInfo" %>
<%@ page import="hk.pojo.AdminInfo" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">

    <script type="text/javascript" src="js/jquery-1.8.0.js"></script>
    <script type="text/javascript" src="js/jquery.easing.js"></script>
    <script type="text/javascript" src="js/jquery.accordion.js"></script>
    <script type="text/javascript">
        $(function(){
            $('#navigation').accordion({
                active:1,   /* 第三个被激活 */
                header: '.head',
                /*navigation1: false,  */
                event: 'click',
                fillSpace: true,
                animated: 'bounceslide'   /*slide,bounceslide ,bounceslide,easeslide'*/
            });
        });
    </script>

    <link rel="stylesheet" type="text/css" href="css/menu.css">

    <meta http-equiv="cache-control" content="no-cache">
</head>
<body>
<%
    DaoMenu daoMenu = new DaoMenuImpl();

    AdminInfo admin=(AdminInfo)session.getAttribute("session_admin");
    List<MenuInfo> menuList= daoMenu.getMenuList(0,admin.getRoleId());
    request.setAttribute("menulist",menuList);
%>
    <ul id="navigation">
        <c:forEach items="${menulist}" var="m">
            <li>
                <a class="head">${m.menuName}</a>
                <ul>
                    <li>
                        <c:forEach items="${m.subMenuList}" var="m_sub">
                            <a href="${m_sub.url}" target="${m_sub.target}"><img src="images/${m_sub.icon}"/><label>${m_sub.menuName}</label></a>
                        </c:forEach>
                    </li>
                </ul>
            </li>
        </c:forEach>

        <li> <a class="head">网站前台</a>
            <ul>
                <li><a href="http://localhost:8080/shop" target="_blank"><img src="images/main_50.gif" /><label>网站前台</label></a></li>
            </ul>
        </li>
    </ul>


</body>
</html>